

DEFINE VARIABLE part LIKE pt_part.
DEFINE VARIABLE qty LIKE htpd_qty .
DEFINE VARIABLE site LIKE si_site.
DEFINE VARIABLE loc LIKE loc_loc .


    INPUT FROM VALUE("c:\part.csv").

    REPEAT ON ERROR UNDO, LEAVE:

        IMPORT DELIMITER "," part site loc qty NO-ERROR.

        CREATE htpd_det.

        IF site = "500" AND loc = "RW01" THEN 
            ASSIGN 
                htpd_nbr = "DA640044".
        ELSE IF site = "500" AND loc = "SF01" THEN 
            ASSIGN 
                htpd_nbr = "DA640045".
        ELSE IF site = "510" AND loc = "RW01" THEN 
            ASSIGN 
                htpd_nbr = "DB640006".
        IF site = "520" AND loc = "RW01" THEN 
            ASSIGN 
                htpd_nbr = "DC640001".

        ASSIGN
            htpd_part = part
            htpd_qty = qty
            htpd_qty_chg = qty
            .

    END.

